package com.yfqy.app.enums;

import lombok.Getter;

@Getter
public enum ConfigKey {
    ORDER_REWARD_RATIO("order_reward_ratio"),
    DEDUCTION_RULE("deduction_rule"),
    REGISTER_REWARD("register_reward"),
    BIND_MOBILE_REWARD("bind_mobile_reward"),
    CANCEL_TIMEOUT("cancel_timeout"),
    AUTO_COMPLETE("auto_complete"),
    SHIPPING_FEE("shipping_fee"),
    COMMISSION_RATIO("commission_ratio"),
    WITHDRAW_SETTING("withdraw_setting");

    private final String value;

    ConfigKey(String value) {
        this.value = value;
    }

    public static ConfigKey fromValue(String value) {
        for (ConfigKey key : values()) {
            if (key.value.equals(value)) {
                return key;
            }
        }
        throw new IllegalArgumentException("未知的配置键: " + value);
    }
}
